/*
 * @Author: Zhouhai 497675647@qq.com
 * @Date: 2023-02-08 14:14:11
 * @LastEditors: Zhouhai 497675647@qq.com
 * @LastEditTime: 2023-02-09 17:19:38
 */
import { Component, PropsWithChildren } from 'react'
import { View, Text ,Image} from '@tarojs/components'
import { observer, inject } from 'mobx-react'
import logoPng from '../../resource/logo.png'
import './index.scss'

type PageStateProps = PropsWithChildren & {
  store: {
    counterStore: {
      counter: number,
      increment: Function,
      decrement: Function,
      incrementAsync: Function
    }
  }
}

interface home {
  props: PageStateProps;
}

@inject('store')
@observer
class home extends Component<PropsWithChildren> {
  componentDidMount() { }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }

  increment = () => {
    const { counterStore } = this.props.store
    counterStore.increment()
  }

  decrement = () => {
    const { counterStore } = this.props.store
    counterStore.decrement()
  }

  incrementAsync = () => {
    const { counterStore } = this.props.store
    counterStore.incrementAsync()
  }

  render() {
    return (
      <View className="content">
        <Image className="logo" src={logoPng}/>
        <View className="text-area">
          <Text className="title">Hello RuoYi</Text>
        </View>
      </View>
    )
  }
}

export default home
